# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=cudd
pkgver=3.0.0
pkgrel=1
pkgdesc="A package for the manipulation of Binary Decision Diagrams (BDDs) and similar structures"
arch=("loong64" "x86_64")
license=("BSD")
url="https://github.com/ivmai/cudd"
depends=("gcc-libs")
source=("https://github.com/ivmai/cudd/archive/cudd-3.0.0.tar.gz")
sha512sums=('a26728fedc3033ae2a842000f43f215b4abc914cd00fe0097fd483e59dc630568bfa6a115baa93af94b2f70f3d538761a12143fdb757167e90395c9fd244318c')

build() {
  cd cudd-cudd-$pkgver
  ./configure --prefix=/usr --enable-shared --enable-dddmp --enable-obj
  make
}

package() {
  cd cudd-cudd-$pkgver
  make DESTDIR="$pkgdir/" install

  # Install more headers to a separate dir
  install -Dm644 util/util.h -t "$pkgdir"/usr/include/cudd/
  install -Dm644 config.h -t "$pkgdir"/usr/include/cudd/
  install -Dm644 mtr/mtr.h -t "$pkgdir"/usr/include/cudd/

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
